#include("LayuiHead.html")
<div class="layui-fluid layui-card">
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">图片上传</li>
            <li>查看原码</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <div class="layui-card-body ">
                    <form action="" class="layui-form  margin-10" lay-filter="form">
                        <input type="hidden" id="actions" name="actions" value="EDIT">
                        <input type="hidden" id="test_slider" name="test_slider" value="56">
                        <input type='hidden' name='_jfinal_token' id='_jfinal_token' value='6686844583989043146'/>

                        <div class="layui-row">
                            <div class="layui-col-md12">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">测试ID</label>

                                    <div class="layui-input-block">
                                        <input type="text" readonly name="test_id" placeholder="自动生成" value="17" class="layui-input input-readonly">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-md12">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">图片</label>

                                    <div class="layui-input-inline">
                                        <input type="text" lay-skin="myupload" class="layui-hide" width="110" height="60" btn_class="layui-btn-xs btn-change-8"
                                               name="test_img" view_path="/images/show/202211/1667989482479.png" value="/show/202211/1667989482479.png"/>
                                    </div>
                                    <div class="layui-input-inline" style="width:220px">
                                        <input id="up1" type="text" lay-skin="myupload" class="layui-hide" url="../testtable/UploadImages"
                                               width="110" height="60" view_path=""
                                               btn_txt="上传(120*60)" btn_class="layui-btn-xs btn-change-13"
                                               size="300" accept="images" exts="jpg|png|gif"
                                               name="test_img2" value=""/>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-md12">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">备注</label>

                                    <div class="layui-input-block">
                                        <textarea name="test_desc" placeholder="请输入备注" class="layui-textarea" style="height:60px"></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button type="submit" class="layui-btn" lay-submit="" lay-filter="Submit1">立即提交</button>
                                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
            <div class="layui-tab-item">
                 <pre class="layui-code" lay-lang="HTML" lay-title="对应的HTML结构" encode="true">
&lt;input id="up1" type="text" lay-skin="myupload" class="layui-hide" url="UploadImages"
width="110" height="60" view_path=""
btn_txt="上传(120*60)" btn_class="layui-btn-xs btn-change-13"
size="300" accept="images" exts="jpg|png|gif"
name="test_img2" value=""/&gt;
                 </pre>
                <pre class="layui-code" lay-lang="JS" lay-title="对应的JS代码">
    layui.use(['myUpload'], function () {
        layui.myUpload.render({url: '../testtable/UploadImages', btn_class: "layui-btn-sm btn-change-13", btn_txt: '上传'});
    });
                </pre>
            </div>
        </div>
    </div>
</div>
<script>
    var TreeInit = 'TestIndex';
    layui.use(['myUpload'], function () {
        layui.myUpload.render({url: '../testtable/UploadImages', btn_class: "layui-btn-sm btn-change-13", btn_txt: '上传'});
    });

    layui.use(['form', 'myTool'], function () {
        layui.form.on('submit(Submit1)', function (data) {
            top.layer.alert('值：<br/>' + data.field.test_img + '<br/>' + data.field.test_img2, {offset: "100px"});
            return false;
        });
    });

</script>
#include("LayuiBottom.html")